package com.cloud.drore.eboss.operation.controller;

import com.cloud.drore.eboos.common.base.ResultMessage;
import com.cloud.drore.eboos.common.entity.operation.PriceAndStockToOTAPo;
import com.cloud.drore.eboos.exception.BusinessException;
import com.cloud.drore.eboss.login.user.Anon;
import com.cloud.drore.eboss.operation.supplierApiService.IOTAGetProductPriceAndStockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/3/7 10:50 <br>
 * @Author: <a href="1451173193@qq.com">杨亮</a>
 */
@RestController
@RequestMapping("/OTA")
@Api(value = "/OTA获取产品的价格", description = "OTA获取产品的价格-杨亮")
@Anon
public class OTAGetProductPriceController {
    @Autowired
    private IOTAGetProductPriceAndStockService getProductPriceAndStockService;
    @ApiOperation(value = "OTA获取产品的价格")
    @PostMapping(value = "/getProductPriceByParams")
    public ResultMessage getProductPriceByParams(@RequestBody PriceAndStockToOTAPo po) throws BusinessException {

        return getProductPriceAndStockService.getProductPriceAndStock(po.getMerchantId(),po.getProductNum());
    }

}
